home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / ubbs208b.zip / UBBSFMTS.TXT < prev    next >
Text File  |  1991-07-24  |  39KB  |  972 lines

  1.                          UltraBBS v2.08 File Formats
  2.                                   07/25/91
  3.  
  4. Message File Format
  5. -------------------
  6.  
  7. In the messages file (extension ".DAT"), each record is 150 bytes long. The 
  8. first record in each messages file has the following format:
  9.  
  10. struct firstrecord
  11. {
  12.  long nextrecord;
  13.  long highmsgnum;
  14.  long lowmsgnum;
  15.  long lastfidomsgimported;
  16.  char reserved[134];
  17. }
  18.  
  19. The nextrecord variable contains the next record # that should be used in 
  20. the messages file (first record in file is record # 0).  The highmsgnum 
  21. variable contains the current high message number in the message base, and 
  22. lowmsgnum contains the current low message number in the message base.
  23. The lastfidomsgimported variable is used by the FIDOCVT program and
  24. is the number of the last message that was imported by FIDOCVT (or the
  25. last message that has already been exported to FIDO format).
  26.  
  27. The header of each message in the messages file has the following format:
  28.  
  29. struct msgrecord
  30. {
  31.  long msgnum;
  32.  unsigned char from[26];
  33.  unsigned char to[26];
  34.  unsigned char msgdate[9];
  35.  unsigned char msgtime[6];
  36.  unsigned char subject[26];
  37.  unsigned char msgpass[21];
  38.  unsigned char active;
  39.  long referto;
  40.  unsigned char datercvd[9];
  41.  unsigned char records;
  42.  unsigned char private;
  43.  unsigned char timercvd[6];
  44.  unsigned char echoflag;
  45.  unsigned char rr;
  46.  unsigned char perm;
  47.  unsigned char attached;
  48.  int hasreplies;
  49.  unsigned char reserved[4];
  50. }
  51.  
  52. All character arrays ("strings") are NULL TERMINATED character arrays!  
  53. They are NOT padded with spaces!  This applies for the rest of this file, 
  54. except where specifically stated otherwise.  Whatever follows the null byte 
  55. is of no consequence, it is ignored.
  56.  
  57. The msgnum variable is the number of this message.  The from variable
  58. is the name of the user who entered the message.  The to variable is
  59. the name of the user to whom the message was entered.  The msgdate variable
  60. is the date on which the message was entered ("MM/DD/YY" format).  The
  61. msgtime variable is the time on which the message was entered ("HH:MM"
  62. format).  The subject variable is the subject of the message.  The msgpass
  63. variable is the password of the message, it should be null if there is no
  64. password on the message.  The active variable is nonzero if the message is
  65. active, zero if the message is killed.  The referto variable contains the
  66. message number of the message which this message is a reply off of, 0
  67. if this message is not a reply to any other message.  The datercvd variable
  68. contains the date on which this message was received ("MM/DD/YY" format),
  69. it should be a 0 length string if the message has not been received yet.  
  70. The records variable contains the # of records in the message's text area 
  71. (it does NOT include the header!).  The private variable is nonzero if the 
  72. message is receiver only, or zero if it is public or password protected.  
  73. The timercvd variable contains the time on which this message was received 
  74. ("HH:MM" format), it should be a 0 length string if the message has not been
  75. received yet.  The echoflag variable is used only for conferences designated
  76. as 'echo' conferences.  If nonzero, it is assumed that the message is
  77. supposed to be exported for echomail, if zero, it should stay only in the
  78. local message base.  The rr variable is nonzero if the user has requested a
  79. return receipt, zero if he has not (a return receipt is generated when the 
  80. message is first received, the rr flag is NOT changed).  The perm variable 
  81. is nonzero if the message cannot be killed by the receiver, zero if it can 
  82. (this should only be used on public messages).  The attached variable is 
  83. nonzero if a file is attached to the message, zero if a file is not 
  84. attached.  The hasreplies variable is nonzero if the message has replies
  85. to it, otherwise it is set to zero.  The reserved variable is used for
  86. future use and should be set to all nulls. If a file is attached, it will
  87. be placed in a subdirectory off of your attach directory named
  88. MSGNUMBER.CONF (for example, ATTACHDIR\1.0\filename.ext for message # 1 in
  89. conference # 0).
  90.  
  91. The actual text records of the message (following each header) are strings
  92. of text, each representing a line of the message, followed by (Ctrl-A)
  93. characters.  The very last (Ctrl-A) of the message (representing the
  94. (Enter) on the last line of the message) is followed by a (Ctrl-B)
  95. character.  The rest of the current record is padded out by unpredictable
  96. characters to the next 150-byte boundary.
  97.  
  98. The records in the messages index file (extension ".NDX") have the 
  99. following format:
  100.  
  101. struct messageindexrecord
  102. {
  103.  long record;
  104.  unsigned char to[26];
  105.  unsigned char from[26];
  106.  unsigned char private;
  107.  unsigned char active;
  108.  unsigned char subject[26];
  109. }
  110.  
  111. The index begins at the low message number specified in the first record of 
  112. the message file.  The long integer is the record # in the messages file of 
  113. the message it represents (first record in file is record # 0 again). For 
  114. example, if the low message number is 5, and you wanted to find message # 5 
  115. in the messages file, you would look at the first record in the index file 
  116. to get message # 5's record in the messages file.  The to, from, private, 
  117. active, and subject fields should correspond to those fields in that 
  118. message's actual header.  Since the index file is based on the lowmsgnum 
  119. variable, you will not want to change the lowmsgnum variable at any time 
  120. unless your program does a complete pack of the message files.
  121.  
  122. FileBase File Format
  123. --------------------
  124.  
  125. In the FileBase data file (extension ".DAT"), each record is 338 bytes 
  126. long.  Each file entry in the file has the following format:
  127.  
  128. struct filerecord
  129.  unsigned char file[13];
  130.  unsigned long filesize;
  131.  unsigned char uploadedby[26];
  132.  int timesdled;
  133.  unsigned char filelocation[41];
  134.  unsigned char lastdl[9];
  135.  unsigned char dateoful[9];
  136.  int freefile;
  137.  unsigned char id[5];
  138.  unsigned char descrip[225];
  139.  int deleteflag;
  140. }
  141.  
  142. The file variable contains the actual file name of the file on the BBS.  
  143. The filesize variable contains the size (in bytes) of the file on disk, or
  144. 0 if the file has a "variable" size.  The uploadedby field contains the full
  145. name of the user who uploaded the file.  The timesdled field contains the
  146. number of times that this file has been downloaded.  The filelocation
  147. variable contains the actual physical location of the file (on the disk
  148. drive).  The lastdl and dateoful fields contain (in "MM/DD/YY" format) the
  149. last date the file was downloaded, and the date that the file was uploaded,
  150. respectively.  The freefile variable is nonzero if the file is free (no
  151. download charge), or zero if not.  The idvariable contains the 4 character
  152. Directory ID of the file.  The descrip variable contains the description of
  153. the file (5 lines, 45 characters each).  The descrip variable is NOT null
  154. terminated and is padded with spaces!  The deleteflag variable is nonzero
  155. if the file is flagged for deletion, zero if not.
  156.  
  157. The FileBase index files have a one-character extension that is the first 
  158. letter in their file name.  The records in the FileBase index files have 
  159. the following format:
  160.  
  161. struct fileindexrecord
  162. {
  163.  unsigned char file[13];
  164.  unsigned char id[5];
  165.  long record;
  166.  long binarydate;
  167. }
  168.  
  169. The file variable contains the file name of the file.  The id variable 
  170. contains the 4 character Directory ID of the file.  The record variable 
  171. contains the actual record (again, first record in data file is # 0) in the 
  172. FileBase data file where complete information on the file is stored.  The 
  173. binarydate field contains the file's date as a long integer.  This value is 
  174. obtained by rearranging the fields of the date to YYMMDD and then taking
  175. the value into a long integer (ie: 10/12/90 = 901012).
  176.  
  177. User File Format
  178. ----------------
  179.  
  180. In the Users data file (extension ".DAT"), each record is 1695 bytes 
  181. long.  Each user entry in the file has the following format:
  182.  
  183. struct userrecord
  184. {
  185.  unsigned char name[26];
  186.  unsigned char userpass[21];
  187.  int security;
  188.  int expert;